package com.tpo.spring.batch.writer.dao;

import com.tpo.spring.batch.SettlementData;
import com.tpo.spring.batch.dao.TransactionsDao;
import org.springframework.batch.item.ItemWriter;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * Created by Tiberiu on 26/10/14.
 */
public class TransactionsDaoWriter implements ItemWriter<SettlementData>{

    @Autowired
    TransactionsDao transactionsDao;

    @Override
    public void write(List<? extends SettlementData> items) throws Exception {
        for (SettlementData item : items)
            transactionsDao.update(item);
    }
}
